package com.luhan.lhframe.api.remote;

import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.luhan.lhframe.api.ApiHttpClient;

/**
 * 处理网络请求 需要 要提交的字段以及一个AsyncHttpResponseHandler的实例
 * created by LuHan at 2016/7/5 下午 2:57
 */
public class MyHttpApi {
    /**
     * 登陆
     *
     * @param username
     * @param password
     * @param handler
     */
    public static void login(String username, String password,
                             AsyncHttpResponseHandler handler) {
        RequestParams params = new RequestParams();
        params.put("phone", username);
        params.put("password", password);
        params.put("keep_login", 1);
        String loginurl = "sdwl/login.do";
        ApiHttpClient.post(loginurl, params, handler);
    }
}
